<?php

/**
 * tblPrice form base class.
 *
 * @method tblPrice getObject() Returns the current form's model object
 *
 * @package    travis
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasetblPriceForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                 => new sfWidgetFormInputHidden(),
      'hotel_id'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('HotelPrice'), 'add_empty' => true)),
      'room_id'            => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('RoomPrice'), 'add_empty' => true)),
      'date'               => new sfWidgetFormDate(),
      'period'             => new sfWidgetFormInputText(),
      'type'               => new sfWidgetFormInputText(),
      'fit_price_usd'      => new sfWidgetFormInputText(),
      'fit_price_nis'      => new sfWidgetFormInputText(),
      'bar_price_usd'      => new sfWidgetFormInputText(),
      'bar_price_nis'      => new sfWidgetFormInputText(),
      'cascade_price_usd'  => new sfWidgetFormInputText(),
      'cascade_price_nis'  => new sfWidgetFormInputText(),
      'special_price_usd'  => new sfWidgetFormInputText(),
      'special_price_nis'  => new sfWidgetFormInputText(),
      'russian_market_usd' => new sfWidgetFormInputText(),
      'russian_market_nis' => new sfWidgetFormInputText(),
      'commission'         => new sfWidgetFormInputText(),
      'create_time'        => new sfWidgetFormDateTime(),
      'update_time'        => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                 => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'hotel_id'           => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('HotelPrice'), 'required' => false)),
      'room_id'            => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('RoomPrice'), 'required' => false)),
      'date'               => new sfValidatorDate(array('required' => false)),
      'period'             => new sfValidatorInteger(array('required' => false)),
      'type'               => new sfValidatorInteger(array('required' => false)),
      'fit_price_usd'      => new sfValidatorPass(array('required' => false)),
      'fit_price_nis'      => new sfValidatorPass(array('required' => false)),
      'bar_price_usd'      => new sfValidatorPass(array('required' => false)),
      'bar_price_nis'      => new sfValidatorPass(array('required' => false)),
      'cascade_price_usd'  => new sfValidatorPass(array('required' => false)),
      'cascade_price_nis'  => new sfValidatorPass(array('required' => false)),
      'special_price_usd'  => new sfValidatorPass(array('required' => false)),
      'special_price_nis'  => new sfValidatorPass(array('required' => false)),
      'russian_market_usd' => new sfValidatorPass(array('required' => false)),
      'russian_market_nis' => new sfValidatorPass(array('required' => false)),
      'commission'         => new sfValidatorPass(array('required' => false)),
      'create_time'        => new sfValidatorDateTime(array('required' => false)),
      'update_time'        => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('tbl_price[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'tblPrice';
  }

}
